<?php
//引入路由
use Illuminate\Support\Facades\Route;

// 引入控制器
use App\Http\Controllers\Business as BusinessController; //引入用户控制器
use App\Http\Controllers\Address as AddressController; //引入收获地址控制器
use App\Http\Controllers\Product as ProductController; //引入商品控制器
use App\Http\Controllers\Cart as CartController; //引入购物车控制器
use App\Http\Controllers\Order as OrderController; //引入订单控制器


// 用户路由组
Route::prefix('/business')->group(function () {
    Route::post('/register', [BusinessController::class, 'register']); //注册
    Route::post('/login', [BusinessController::class, 'login']); //登录
    Route::post('/check', [BusinessController::class, 'check']); //
    Route::post('/profile', [BusinessController::class, 'profile']); //个人中心
    Route::post('/sendmail', [BusinessController::class, 'sendmail']);
    Route::post('/email', [BusinessController::class, 'email']);
    Route::post('/consume', [BusinessController::class, 'consume']);
    Route::post('/recharge', [BusinessController::class, 'recharge']);
    Route::post('/rechargelist', [BusinessController::class, 'rechargelist']);
});


//收获地址路由
Route::prefix('/address')->group(function () {
    Route::post('/add', [AddressController::class, 'add']);
    Route::post('/index', [AddressController::class, 'index']);
    Route::post('/info', [AddressController::class, 'info']);
    Route::post('/edit', [AddressController::class, 'edit']);
    Route::post('/del', [AddressController::class, 'del']);
    Route::post('/check', [AddressController::class, 'check']);
    Route::post('/order', [AddressController::class, 'order']);
});

// 产品
Route::prefix('/product')->group(function () {
    Route::post('/index', [ProductController::class, 'index']);
    Route::post('/type', [ProductController::class, 'type']);
    Route::post('/list', [ProductController::class, 'list']);
    Route::post('/info', [ProductController::class, 'info']);
    Route::post('/mind', [ProductController::class, 'mind']);
});

// 购物车
Route::prefix('/cart')->group(function () {
    Route::post('/add', [CartController::class, 'add']); //添加
    Route::post('/index', [CartController::class, 'index']);
    Route::post('/edit', [CartController::class, 'edit']);
    Route::post('/del', [CartController::class, 'del']);
});

//订单
Route::prefix('/order')->group(function () {
    Route::post('/add', [OrderController::class, 'add']);
    Route::post('/index', [OrderController::class, 'index']);
    Route::post('/sgladd',[OrderController::class,'sgladd']);
    Route::post('/sglindex',[OrderController::class,'sglindex']);
    Route::post('/info',[OrderController::class,'info']);
    Route::post('/receipt',[OrderController::class,'receipt']);
    Route::post('/express',[OrderController::class,'express']);
    Route::post('/rate',[OrderController::class,'rate']);
    Route::post('/comment',[OrderController::class,'comment']);
    Route::post('/pay',[OrderController::class,'pay']);
    Route::post('/refund',[OrderController::class,'refund']);
    Route::post('/rejected',[OrderController::class,'rejected']);
    Route::post('/refundgoods',[OrderController::class,'refundgoods']);
    Route::post('/back',[OrderController::class,'back']);
});
